home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 …ember: Reference Library / Dev.CD Dec 98 RL1.toast / Technical Documentation / develop / develop Issue 26 / develop Issue 26 code / Truffles - Display Mgr. / Sprocket / Interfaces / SortedDynamicArray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-03  |  853 b   |  40 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        SortedDynamicArray.h
  3.  
  4.     Contains:    An abstract base class for sorted dynamic arrays
  5.                 
  6.     Written by: Dave Falkenburg
  7.     
  8.     Copyright:    © 1994-95 by Dave Falkenburg, all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.      
  12.          <1>      1/3/95    DRF        First checked in.
  13.  */
  14.  
  15. #ifndef        _SORTEDDYNAMICARRAY_
  16. #define        _SORTEDDYNAMICARRAY_
  17.  
  18. #include    "DynamicArray.h"
  19.  
  20. class    TSortedDynamicArray : public TDynamicArray
  21.     {
  22. protected:
  23.     //    Protect the constructor because it isn’t legal
  24.     //    to create a TSortedDynamicArray directly.
  25.     
  26.                             TSortedDynamicArray();
  27.     
  28.     //    methods which must be overridden:
  29.     
  30.     typedef    SInt32            CompareResult;
  31.     virtual    CompareResult    Compare(ArrayElementPtr element1,
  32.                                     ArrayElementPtr    element2) = 0;
  33.  
  34. public:
  35.     OSErr                    Add(ArrayElementPtr newElement);
  36.     ArrayElementPtr            Find(ArrayElementPtr prototypeElement);
  37.     };
  38.  
  39. #endif
  40.